import { defHttp as request } from '/@/utils/http/axios';
import { exportFile } from './export';
import qs from 'qs';

export const getMenuListReq = (p) => {
  return request.post({
    url: `/menu/queryMenu`,
    data: p,
  });
};
export const addMenuReq = (p) => {
  return request.post({
    url: `/menu/addMenu`,
    data: p,
  });
};

export const queryMenuReq = (p) => {
  return request.post({
    url: `/core/menu/queryAllMenus`,
    data: p,
  });
};

export const updateMenuReq = (p) => {
  return request.post({
    url: `/menu/updateMenu`,
    data: p,
  });
};
export const deleteMenuReq = (p) => {
  return request.post({
    url: `/menu/deleteMenu`,
    data: p,
  });
};
// // 导出菜单
// export const exportMenuReq = (p) => {
//   return request.post({
//     url: `/core/menu/exportMenu`,
//     data: p,
//   });
// };

export const exportMenuReq = (data) => exportFile('/core/menu/exportMenuExcel', data, null, 'POST');
